package dk.almbrand.microservice.model;

import java.beans.Transient;

import java.io.Serializable;

import java.util.UUID;

public abstract class Event<T> implements Serializable {
    
    private String applicationId = "";
    private String key = "";    
    private T object;
    private transient String json = "";
        
    public Event() {
        // Automatically generate a uniqe key. 
        key = UUID.randomUUID().toString();
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getKey() {
        return key;
    }

    public void setObject(T object) {
        this.object = object;
    }

    public T getObject() {
        return object;
    }

    public void setApplicationId(String applicationId) {
        this.applicationId = applicationId;
    }

    public String getApplicationId() {
        return applicationId;
    }
    
    public void setJson(String json) {
        this.json = json;
    }

    public String getJson() {
        return json;
    }
}
